<template>
	<view>
		<view class="bangdan" :style="style">
			<view class="one">
				<image class="img" :src="src" mode="widthFix"></image>
				<view>
					<view class="two">
						<view class="three">
							{{m1}}<text style="color: #EFC775;">&nbsp; {{fen1}}</text><br>
							{{m2}}<text style="color: #EFC775;">&nbsp; {{fen2}}</text><br>
							{{m3}}<text style="color: #EFC775;">&nbsp; {{fen3}}</text><br>
						</view>
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "bangdan-yxy",
		props: {
			src: {
				type: String,
				default: () => {
					return '/static/yxy3.png'
				}
			},
			m1: {
				type: String,
				default: () => {
					return '1.肖申克救赎'
				}
			},
			m2: {
				type: String,
				default: () => {
					return '2.霸王别姬'
				}
			},
			m3: {
				type: String,
				default: () => {
					return '3.阿甘正传'
				}
			},
			fen1: {
				type: String,
				default: () => {
					return '9.7分'
				}
			},
			fen2: {
				type: String,
				default: () => {
					return '9.6分'
				}
			},
			fen3: {
				type: String,
				default: () => {
					return '9.5分'
				}
			}
		},
		data() {
			return {
				style: {
					width: '100px',
					height: '100px',
				}
			};
		},
		created() {
			// 组件创建完成后，我们去动态的算出组件的宽高
			let info = uni.getWindowInfo()
			console.log(info);
			// 屏幕宽度
			let screenWidth = info.screenWidth
			let width = screenWidth - 16
			let height = (width - 50) / 4.5 * 1.55
			// 设置宽度
			this.style.width = width + 'px'
			// 设置高度
			this.style.height = height + 'px'


		}
	}
</script>

<style scoped>
	.bangdan {

		border-radius: 5px;
		margin-top: 4px;
		position: relative;
		left: 8px;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.one {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.img {
		width: 95px;
		height: 95px;
		border-radius: 5px;

	}

	.two {
		border-right: 1.5px solid #E7E7E7;
		border-top: 1.5px solid #E7E7E7;
		border-bottom: 1.5px solid #E7E7E7;
		border-top-right-radius: 4px;
		border-bottom-right-radius: 4px;
		width: 517rpx;
		height: 146rpx;
		display: flex;
		align-items: center;
		/* background-color: aquamarine; */
	}

	.three {
		padding-left: 20px;
		font-size: 14px;
		line-height: 1.7em;
		width: 180px;
	}
</style>
